﻿using System;
using TechTalk.SpecFlow;
using WatiN.Core;

namespace Testicide_BDD
{
    [Binding]
    public class Managing_HomeSteps
    {
        private IE _browser;
        public Managing_HomeSteps()
        {
            _browser = new IE();
        }

        [Given(@"I'm on Home page")]
        public void GivenIMOnHomePage()
        {
            _browser.GoTo("http://localhost:57662/");
        }

        [When(@"I press MyProjects")]
        public void WhenIPressMyProjects()
        {
            var link = _browser.Link("MyProjects");
            link.Click();
        }

        [When(@"I press Contact")]
        public void WhenIPressContact()
        {
            var link = _browser.Link("Contact");
            link.Click();
        }

        [When(@"I press About")]
        public void WhenIPressAbout()
        {
            var link = _browser.Link("About");
            link.Click();
        }

        [Then(@"I should go to the Projects page")]
        public void ThenIShouldGoToTheProjectsPage()
        {
            _browser.GoTo("http://localhost:57662/Project");
        }
        [Then(@"I should go to the Contact page")]
        public void ThenIShouldGoToTheContactPage()
        {
            _browser.GoTo("http://localhost:57662/Contact");
        }

        [Then(@"I should go to the About page")]
        public void ThenIShouldGoToTheAboutPage()
        {
            _browser.GoTo("http://localhost:57662/About");
        }

        [AfterScenario]
        public void ddd()
        {
            _browser.Dispose();
        }
    }
}